// hanoy.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <stdio.h>
void hanoy(int num, char a, char b, char c, int &s)
{
	if (num>0)
	{
		hanoy(num-1, a,c, b,s);
		printf("%c--->%c\n ", a, c);
		s++;
		hanoy(num-1,b, a, c,s);
	}
}

int _tmain(int argc, _TCHAR* argv[])
{
	char a, b, c;
	int num;
	int s=0;
	printf("number of rings=");
	scanf("%d", &num);
	a='A';
		b='B';
		c='C';
	hanoy(num, a, b, c,s);
	printf("%d\n, shagov", s);
	return 0;
}

